#ifndef __MY_DEQUE_HPP__

#define __MY_DEQUE_HPP__


class dequebase
{
    typedef struct dataNode dataNode;

    public:
        dequebase();
        dequebase(int);
        dequebase(dequebase&, int);
        virtual ~dequebase();

        void *push_back(void*);
        void *push_front(void*);
        void *pop_back();
        void *pop_front();

        int size(){return current_size;}

        bool operator==(void *nil){return head==NULL;}
        void *operator*(){if(current==NULL)return NULL;else return current->dataPtr;}
        dequebase &operator++(){return current=current->next;}
        dequebase &operator--(){return current=current->prev;}

        
    private:
        int current_size;
        int max_size;

        dataNode *head;
        dataNode *first;    //队列的第一个
        dataNode *last;     //队列的最后一个
        dataNode *current;  //对象运算时元素的位置
};


#endif  //__MY_DEQUE_HPP__
